package com.oracle.oa.biz.impl;

import java.text.SimpleDateFormat;
import java.util.Date;

import com.oracle.oa.biz.OperatelogBiz;
import com.oracle.oa.dao.OperatelogDao;
import com.oracle.oa.dao.impl.OperatelogDaoImpl;
import com.oracle.oa.entity.Operatelog;
import com.oracle.oa.entity.Userinfo;

public class OperatelogBizImpl extends BaseBizImpl implements OperatelogBiz{
	public static Userinfo user;
	public static OperatelogDao operatelogDao;
	/**
	 * @
	 * @param user  操作者   Userinfo对象
	 * @param operatenname  操作的名称String  例：删除
	 * @param operatedesc  操作的描述String  例：删除用户
	 */
	public static void add(String operatenname,String operatedesc){
		/*操作用户
		 * 操作名称
		 * 操作对象  （去除 不要）
		 * 操作描述
		 * 操作时间*/
		SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Operatelog operatelog=new Operatelog();
		operatelog.setUserinfo(user);
		operatelog.setOperatenname(operatenname);
		operatelog.setObjectid("没有对象");
		operatelog.setOperatedesc(operatedesc);
		operatelog.setOperatetime(sdf.format(new Date()));
		operatelogDao.save(operatelog);
	}
	
	public OperatelogDao getOperatelogDao() {
		return operatelogDao;
	}

	public void setOperatelogDao(OperatelogDao operatelogDao) {
		this.operatelogDao = operatelogDao;
	}
	
	
}
